import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
import dotenv from 'dotenv'

// 加载环境变量
dotenv.config()

// https://vite.dev/config/
export default defineConfig({
  base: process.env.VITE_BASE,
  build: {
    outDir: `.${process.env.VITE_BASE}`
  },
  plugins: [vue()],
  resolve: {
    alias: {
      '@': resolve(__dirname, './src')
    },
    extensions: ['.vue', '.ts', '.tsx', '.js', '.json']
  },
  server: {
    open: true,
    host: '0.0.0.0'
  }
})
